home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr50 / qbmnus16.zip / NUMBSAMP.BAS < prev    next >
BASIC Source File  |  1993-03-14  |  3KB  |  89 lines

  1. DECLARE SUB NumbersMenu (boxstyle%, tr%, lc%, fc%, bc%)
  2. CLS
  3. PRINT STRING$(2080, 219)
  4. NumbersMenu 5, 5, 40, 1, 14
  5. '           │  │   │  │  └───┐
  6. ' boxstyle%─┘ tr% lc% └─fc%  bc%
  7.  
  8. '          ──────────────────────────────────────────
  9. ' Boxstyle:
  10. ' There are five choices of boxstyles (Press F 3 on the Tools Menu
  11. ' to see what they look like.)
  12. '          ──────────────────────────────────────────
  13. ' Tr%:
  14. ' Location of row for first line of box. (Placing longer menus below
  15. ' rows 12 to 16 will cause them not to properly appear on the screen.)
  16. '          ──────────────────────────────────────────
  17. ' Lc%:
  18. ' Location of first column for first line of box. (Menus are 25 columns
  19. ' wide, placing them near the edge of the screen at column 55 or greater
  20. ' will cause distortion.)
  21. '          ──────────────────────────────────────────
  22. ' Fc%:
  23. ' Foreground color (Pick any color from 1 to 15)
  24. '          ──────────────────────────────────────────
  25. ' Bc%:
  26. ' Background color (Pick any color from 1 to 15)
  27.  
  28. SUB NumbersMenu (boxstyle%, tr%, lc%, fc%, bc%)
  29. DIM menu$(0 TO 11)
  30. COLOR fc%, bc%
  31. SELECT CASE boxstyle%
  32. CASE 1
  33. side$ = "│"
  34. LOCATE tr%, lc%: PRINT "┌───────────────────────┐"
  35. LOCATE tr% + 11, lc%: PRINT "└───────────────────────┘"
  36. CASE 2
  37. side$ = "║"
  38. LOCATE tr%, lc%: PRINT "╔═══════════════════════╗"
  39. LOCATE tr% + 11, lc%: PRINT "╚═══════════════════════╝"
  40. CASE 3
  41. side$ = "║"
  42. LOCATE tr%, lc%: PRINT "╓───────────────────────╖"
  43. LOCATE tr% + 11, lc%: PRINT "╙───────────────────────╜"
  44. CASE 4
  45. side$ = "│"
  46. LOCATE tr%, lc%: PRINT "╒═══════════════════════╕"
  47. LOCATE tr% + 11, lc%: PRINT "╘═══════════════════════╛"
  48. CASE 5
  49. side$ = "█"
  50. LOCATE tr%, lc%: PRINT STRING$(25, 219)
  51. LOCATE tr% + 11, lc%: PRINT STRING$(25, 219)
  52. END SELECT
  53. FOR set = 1 TO 10
  54. LOCATE set + tr%, lc%: PRINT side$; SPACE$(23); side$
  55. NEXT
  56. menu$(1) = side$ + "   1   QUICKBASIC      " + side$  'spacing for menu items
  57. menu$(2) = side$ + "   2   POWERBASIC      " + side$
  58. menu$(3) = side$ + "   3   VISUAL BASIC    " + side$
  59. menu$(4) = side$ + "   4   TRUE BASIC      " + side$
  60. menu$(5) = side$ + "   5   GW BASIC        " + side$
  61. menu$(6) = side$ + "   6   Z BASIC         " + side$
  62. menu$(7) = side$ + "   7   VB FOR DOS      " + side$
  63. menu$(8) = side$ + "   8   GFA BASIC       " + side$
  64. menu$(9) = side$ + "   9   LIBERTY BASIC   " + side$
  65. menu$(10) = side$ + "   0   EXIT PROGRAM    " + side$
  66. FOR set = 0 TO 11
  67. LOCATE set + tr%, lc%: COLOR fc%, bc%: PRINT menu$(set)
  68. NEXT
  69. DO
  70. DO
  71. key$ = INKEY$
  72. LOOP WHILE key$ = ""
  73. keymove = ASC(RIGHT$(key$, 1))' intrprets scancodes from key press
  74. SELECT CASE keymove  ' edit out END in the cases and place in your own code
  75. CASE 49: END   ' ASCII code for 1
  76. CASE 50: END   '   "    "    "  2
  77. CASE 51: END   '   "    "    "  3
  78. CASE 52: END   '     etc.
  79. CASE 53: END
  80. CASE 54: END
  81. CASE 55: END
  82. CASE 56: END
  83. CASE 57: END
  84. CASE 48: END    ' this line might seem to be out of place but 48 is the ASCII
  85. END SELECT      ' code for 0, which is being used as an exit from the menu
  86. LOOP
  87. END SUB
  88.  
  89.